import VueRouter from 'vue-router'

//引入组件
import Index from '../pages'
import Home from '../pages/home/home'
import Login from '../pages/login/login'
import Register from '../pages/register/register'
import Center from '../pages/center/center'
import Storeup from '../pages/storeup/list'
import News from '../pages/news/news-list'
import NewsDetail from '../pages/news/news-detail'
import payList from '../pages/pay'

import huanzheList from '../pages/huanzhe/list'
import huanzheDetail from '../pages/huanzhe/detail'
import huanzheAdd from '../pages/huanzhe/add'
import yishengList from '../pages/yisheng/list'
import yishengDetail from '../pages/yisheng/detail'
import yishengAdd from '../pages/yisheng/add'
import guahaochuList from '../pages/guahaochu/list'
import guahaochuDetail from '../pages/guahaochu/detail'
import guahaochuAdd from '../pages/guahaochu/add'
import yaofangchuList from '../pages/yaofangchu/list'
import yaofangchuDetail from '../pages/yaofangchu/detail'
import yaofangchuAdd from '../pages/yaofangchu/add'
import jianchahuayanchuList from '../pages/jianchahuayanchu/list'
import jianchahuayanchuDetail from '../pages/jianchahuayanchu/detail'
import jianchahuayanchuAdd from '../pages/jianchahuayanchu/add'
import keshixinxiList from '../pages/keshixinxi/list'
import keshixinxiDetail from '../pages/keshixinxi/detail'
import keshixinxiAdd from '../pages/keshixinxi/add'
import shijianduanList from '../pages/shijianduan/list'
import shijianduanDetail from '../pages/shijianduan/detail'
import shijianduanAdd from '../pages/shijianduan/add'
import yishengpaibanList from '../pages/yishengpaiban/list'
import yishengpaibanDetail from '../pages/yishengpaiban/detail'
import yishengpaibanAdd from '../pages/yishengpaiban/add'
import yuyueguahaoList from '../pages/yuyueguahao/list'
import yuyueguahaoDetail from '../pages/yuyueguahao/detail'
import yuyueguahaoAdd from '../pages/yuyueguahao/add'
import binglixinxiList from '../pages/binglixinxi/list'
import binglixinxiDetail from '../pages/binglixinxi/detail'
import binglixinxiAdd from '../pages/binglixinxi/add'
import jianchahuayandanList from '../pages/jianchahuayandan/list'
import jianchahuayandanDetail from '../pages/jianchahuayandan/detail'
import jianchahuayandanAdd from '../pages/jianchahuayandan/add'
import yaopinxinxiList from '../pages/yaopinxinxi/list'
import yaopinxinxiDetail from '../pages/yaopinxinxi/detail'
import yaopinxinxiAdd from '../pages/yaopinxinxi/add'
import chufangxinxiList from '../pages/chufangxinxi/list'
import chufangxinxiDetail from '../pages/chufangxinxi/detail'
import chufangxinxiAdd from '../pages/chufangxinxi/add'
import jiaofeixinxiList from '../pages/jiaofeixinxi/list'
import jiaofeixinxiDetail from '../pages/jiaofeixinxi/detail'
import jiaofeixinxiAdd from '../pages/jiaofeixinxi/add'
import newstypeList from '../pages/newstype/list'
import newstypeDetail from '../pages/newstype/detail'
import newstypeAdd from '../pages/newstype/add'
import systemintroList from '../pages/systemintro/list'
import systemintroDetail from '../pages/systemintro/detail'
import systemintroAdd from '../pages/systemintro/add'

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
	return originalPush.call(this, location).catch(err => err)
}

//配置路由
export default new VueRouter({
	routes:[
		{
      path: '/',
      redirect: '/index/home'
    },
		{
			path: '/index',
			component: Index,
			children:[
				{
					path: 'home',
					component: Home
				},
				{
					path: 'center',
					component: Center,
				},
				{
					path: 'pay',
					component: payList,
				},
				{
					path: 'storeup',
					component: Storeup
				},
				{
					path: 'news',
					component: News
				},
				{
					path: 'newsDetail',
					component: NewsDetail
				},
				{
					path: 'huanzhe',
					component: huanzheList
				},
				{
					path: 'huanzheDetail',
					component: huanzheDetail
				},
				{
					path: 'huanzheAdd',
					component: huanzheAdd
				},
				{
					path: 'yisheng',
					component: yishengList
				},
				{
					path: 'yishengDetail',
					component: yishengDetail
				},
				{
					path: 'yishengAdd',
					component: yishengAdd
				},
				{
					path: 'guahaochu',
					component: guahaochuList
				},
				{
					path: 'guahaochuDetail',
					component: guahaochuDetail
				},
				{
					path: 'guahaochuAdd',
					component: guahaochuAdd
				},
				{
					path: 'yaofangchu',
					component: yaofangchuList
				},
				{
					path: 'yaofangchuDetail',
					component: yaofangchuDetail
				},
				{
					path: 'yaofangchuAdd',
					component: yaofangchuAdd
				},
				{
					path: 'jianchahuayanchu',
					component: jianchahuayanchuList
				},
				{
					path: 'jianchahuayanchuDetail',
					component: jianchahuayanchuDetail
				},
				{
					path: 'jianchahuayanchuAdd',
					component: jianchahuayanchuAdd
				},
				{
					path: 'keshixinxi',
					component: keshixinxiList
				},
				{
					path: 'keshixinxiDetail',
					component: keshixinxiDetail
				},
				{
					path: 'keshixinxiAdd',
					component: keshixinxiAdd
				},
				{
					path: 'shijianduan',
					component: shijianduanList
				},
				{
					path: 'shijianduanDetail',
					component: shijianduanDetail
				},
				{
					path: 'shijianduanAdd',
					component: shijianduanAdd
				},
				{
					path: 'yishengpaiban',
					component: yishengpaibanList
				},
				{
					path: 'yishengpaibanDetail',
					component: yishengpaibanDetail
				},
				{
					path: 'yishengpaibanAdd',
					component: yishengpaibanAdd
				},
				{
					path: 'yuyueguahao',
					component: yuyueguahaoList
				},
				{
					path: 'yuyueguahaoDetail',
					component: yuyueguahaoDetail
				},
				{
					path: 'yuyueguahaoAdd',
					component: yuyueguahaoAdd
				},
				{
					path: 'binglixinxi',
					component: binglixinxiList
				},
				{
					path: 'binglixinxiDetail',
					component: binglixinxiDetail
				},
				{
					path: 'binglixinxiAdd',
					component: binglixinxiAdd
				},
				{
					path: 'jianchahuayandan',
					component: jianchahuayandanList
				},
				{
					path: 'jianchahuayandanDetail',
					component: jianchahuayandanDetail
				},
				{
					path: 'jianchahuayandanAdd',
					component: jianchahuayandanAdd
				},
				{
					path: 'yaopinxinxi',
					component: yaopinxinxiList
				},
				{
					path: 'yaopinxinxiDetail',
					component: yaopinxinxiDetail
				},
				{
					path: 'yaopinxinxiAdd',
					component: yaopinxinxiAdd
				},
				{
					path: 'chufangxinxi',
					component: chufangxinxiList
				},
				{
					path: 'chufangxinxiDetail',
					component: chufangxinxiDetail
				},
				{
					path: 'chufangxinxiAdd',
					component: chufangxinxiAdd
				},
				{
					path: 'jiaofeixinxi',
					component: jiaofeixinxiList
				},
				{
					path: 'jiaofeixinxiDetail',
					component: jiaofeixinxiDetail
				},
				{
					path: 'jiaofeixinxiAdd',
					component: jiaofeixinxiAdd
				},
				{
					path: 'newstype',
					component: newstypeList
				},
				{
					path: 'newstypeDetail',
					component: newstypeDetail
				},
				{
					path: 'newstypeAdd',
					component: newstypeAdd
				},
				{
					path: 'systemintro',
					component: systemintroList
				},
				{
					path: 'systemintroDetail',
					component: systemintroDetail
				},
				{
					path: 'systemintroAdd',
					component: systemintroAdd
				},
			]
		},
		{
			path: '/login',
			component: Login
		},
		{
			path: '/register',
			component: Register
		},
	]
})
